//
//  GroupItemInfoErrorView.m
//  sentorise
//
//  Created by admin on 2025/9/18.
//

#import "GroupItemInfoErrorView.h"

@interface GroupItemInfoErrorView()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIButton *gotBtn;
@property (weak, nonatomic) IBOutlet UIButton *morebtn;
@property (weak, nonatomic) IBOutlet UILabel *warnLabel;

@property (weak, nonatomic) IBOutlet UILabel *itemTitleLable1;
@property (weak, nonatomic) IBOutlet UILabel *itemDescLable1;
@property (weak, nonatomic) IBOutlet UILabel *itemTitleLable2;
@property (weak, nonatomic) IBOutlet UILabel *itemDescLable2;

@end

@implementation GroupItemInfoErrorView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.text = NSLocalizedString(@"System hint", nil);
        self.warnLabel.text = NSLocalizedString(@"The data acquisition is abnormal due to the inability to connect to the device. Please follow the following steps to troubleshoot:", nil);
        [self.gotBtn setTitle:NSLocalizedString(@"Got it", nil) forState:UIControlStateNormal];
        [self.morebtn setTitle:NSLocalizedString(@"More information", nil) forState:UIControlStateNormal];
        self.itemTitleLable1.text = NSLocalizedString(@"Search signal", nil);
        self.itemDescLable1.text = NSLocalizedString(@"Please make sure the device is turned on, bring your phone close to the device and open the APP to see if the device's Bluetooth signal can be found. If the signal is not found or found but unable to connect, please follow the second step to troubleshoot.", nil);
        self.itemTitleLable2.text = NSLocalizedString(@"Reboot device", nil);
        self.itemDescLable2.text = NSLocalizedString(@"You can try draining the battery, waiting for it to be turned off and then recharged. Try the first step again. If you still cannot find the signal or can search but cannot connect, please contact us", nil);
    }
    return self;
}

- (IBAction)actionClose:(id)sender {
    [self removeFromSuperview];
}

- (IBAction)actionL:(id)sender {
    self.clickItem(0);
    [self removeFromSuperview];
}

- (IBAction)actionR:(id)sender {
    self.clickItem(1);
    [self removeFromSuperview];
}

@end
